		var KEY = { SHIFT:16};    
		var selectIndexs = {firstSelectRowIndex:0, lastSelectRowIndex:0};  
		var inputFlags = {isShiftDown:false};  
		
		 $(function(){ 
			   
			 $("body").keydown(function(event){//响应键盘按下事件  
					var e = event || window.event;    
					var code = e.keyCode | e.which | e.charCode;        
					switch(code) {
						case KEY.SHIFT:    
							inputFlags.isShiftDown = true;  
						break;  
						default:          
					}  
	        });
			 $("body").keyup(function(event) { //响应键盘按键放开的事件  
					var e = event || window.event;    
					var code = e.keyCode | e.which | e.charCode;        
					switch(code) {    
						case KEY.SHIFT:   
							inputFlags.isShiftDown = false;  
							selectIndexs.firstSelectRowIndex = 0;  
						break;  
						default:          
					}  
	        });
			
		
		
/*		 $(".easyui-datagrid").datagrid({
			   onClickRow : function(index, row){
			 	
			 	 if(index != selectIndexs.firstSelectRowIndex && !inputFlags.isShiftDown ){    
			 	     selectIndexs.firstSelectRowIndex = index; 
			 	 }             
			 	 if(inputFlags.isShiftDown) {
			 	     $('.easyui-datagrid').datagrid('clearSelections');  
			 	     selectIndexs.lastSelectRowIndex = index;  
			 	     var tempIndex = 0;  
			 	     if(selectIndexs.firstSelectRowIndex > selectIndexs.lastSelectRowIndex ){  
			 	         tempIndex = selectIndexs.firstSelectRowIndex;  
			 	         selectIndexs.firstSelectRowIndex = selectIndexs.lastSelectRowIndex;  
			 	         selectIndexs.lastSelectRowIndex = tempIndex;  
			 	     }  
			 	     for(var i = selectIndexs.firstSelectRowIndex ; i <= selectIndexs.lastSelectRowIndex ; i++){ 
			 	    	 
			 	         $('.easyui-datagrid').datagrid('selectRow', i);     
			 	     } 
			 	    $('.bookdao-combobox').combobox().next('span').find('input').focus();
			 	    $('.form-control').focus();
			 	    $('.bookdao-combobox').combobox().next('span').find('input').blur();
				 	$('.form-control').blur();
			 	 }             

			   },
			   onCheck: function(index,field, value){
					  
				 	 if(index != selectIndexs.firstSelectRowIndex && !inputFlags.isShiftDown ){    
				 	     selectIndexs.firstSelectRowIndex = index; 
				 	 }             
				 	 if(inputFlags.isShiftDown) {
				 		inputFlags.isShiftDown=false;
				 	     $('.easyui-datagrid').datagrid('clearSelections');  
				 	     selectIndexs.lastSelectRowIndex = index;  
				 	     var tempIndex = 0;  
				 	     if(selectIndexs.firstSelectRowIndex > selectIndexs.lastSelectRowIndex ){  
				 	         tempIndex = selectIndexs.firstSelectRowIndex;  
				 	         selectIndexs.firstSelectRowIndex = selectIndexs.lastSelectRowIndex;  
				 	         selectIndexs.lastSelectRowIndex = tempIndex;  
				 	     }  
				 	     for(var i = selectIndexs.firstSelectRowIndex ; i <= selectIndexs.lastSelectRowIndex ; i++){ 
				 	         $('.easyui-datagrid').datagrid('checkRow', i);     
				 	     }
				 	     $('.bookdao-combobox').combobox().next('span').find('input').focus();
				 	     $('.form-control').focus();
				 	     $('.bookdao-combobox').combobox().next('span').find('input').blur();
				 	     $('.form-control').blur();
				 	 } 
				 	
			}
			 });*/
			 
/*			 $("body table").datagrid({
				   onClickRow : function(index, row){
				 	
				 	 if(index != selectIndexs.firstSelectRowIndex && !inputFlags.isShiftDown ){    
				 	     selectIndexs.firstSelectRowIndex = index; 
				 	 }             
				 	 if(inputFlags.isShiftDown) {
				 	     $('body table').datagrid('clearSelections');  
				 	     selectIndexs.lastSelectRowIndex = index;  
				 	     var tempIndex = 0;  
				 	     if(selectIndexs.firstSelectRowIndex > selectIndexs.lastSelectRowIndex ){  
				 	         tempIndex = selectIndexs.firstSelectRowIndex;  
				 	         selectIndexs.firstSelectRowIndex = selectIndexs.lastSelectRowIndex;  
				 	         selectIndexs.lastSelectRowIndex = tempIndex;  
				 	     }  
				 	     for(var i = selectIndexs.firstSelectRowIndex ; i <= selectIndexs.lastSelectRowIndex ; i++){ 
				 	    	 
				 	         $('body table').datagrid('selectRow', i);     
				 	     } 
				 	    $('.bookdao-combobox').combobox().next('span').find('input').focus();
				 	 }             

				   },
				   onCheck: function(index,field, value){
						  
					 	 if(index != selectIndexs.firstSelectRowIndex && !inputFlags.isShiftDown ){    
					 	     selectIndexs.firstSelectRowIndex = index; 
					 	 }             
					 	 if(inputFlags.isShiftDown) {
					 		inputFlags.isShiftDown=false;
					 	     $('body table').datagrid('clearSelections');  
					 	     selectIndexs.lastSelectRowIndex = index;  
					 	     var tempIndex = 0;  
					 	     if(selectIndexs.firstSelectRowIndex > selectIndexs.lastSelectRowIndex ){  
					 	         tempIndex = selectIndexs.firstSelectRowIndex;  
					 	         selectIndexs.firstSelectRowIndex = selectIndexs.lastSelectRowIndex;  
					 	         selectIndexs.lastSelectRowIndex = tempIndex;  
					 	     }  
					 	     for(var i = selectIndexs.firstSelectRowIndex ; i <= selectIndexs.lastSelectRowIndex ; i++){ 
					 	         $('body table').datagrid('checkRow', i);     
					 	     }
					 	     $('.bookdao-combobox').combobox().next('span').find('input').focus();     
					 	 } 
					 	
				}
				 });*/
		 $(".oasis_datagrid_table").datagrid({
			   onClickRow : function(index, row){
			 	
			 	 if(index != selectIndexs.firstSelectRowIndex && !inputFlags.isShiftDown ){    
			 	     selectIndexs.firstSelectRowIndex = index; 
			 	 }             
			 	 if(inputFlags.isShiftDown) {
			 	     $('.oasis_datagrid_table').datagrid('clearSelections');  
			 	     selectIndexs.lastSelectRowIndex = index;  
			 	     var tempIndex = 0;  
			 	     if(selectIndexs.firstSelectRowIndex > selectIndexs.lastSelectRowIndex ){  
			 	         tempIndex = selectIndexs.firstSelectRowIndex;  
			 	         selectIndexs.firstSelectRowIndex = selectIndexs.lastSelectRowIndex;  
			 	         selectIndexs.lastSelectRowIndex = tempIndex;  
			 	     }  
			 	     for(var i = selectIndexs.firstSelectRowIndex ; i <= selectIndexs.lastSelectRowIndex ; i++){ 
			 	    	 
			 	         $('.oasis_datagrid_table').datagrid('selectRow', i);     
			 	     } 
			 	    //$('.bookdao-combobox').combobox().next('span').find('input').focus();
			 	    $('.form-control').find('input').focus();
			 	   // $('.bookdao-combobox').combobox().next('span').find('input').blur();
				     $('.form-control').blur();
			 	 }             

			   },
			   onCheck: function(index,field, value){
					  
				 	 if(index != selectIndexs.firstSelectRowIndex && !inputFlags.isShiftDown ){    
				 	     selectIndexs.firstSelectRowIndex = index; 
				 	 }             
				 	 if(inputFlags.isShiftDown) {
				 		inputFlags.isShiftDown=false;
				 	     $('.oasis_datagrid_table').datagrid('clearSelections');  
				 	     selectIndexs.lastSelectRowIndex = index;  
				 	     var tempIndex = 0;  
				 	     if(selectIndexs.firstSelectRowIndex > selectIndexs.lastSelectRowIndex ){  
				 	         tempIndex = selectIndexs.firstSelectRowIndex;  
				 	         selectIndexs.firstSelectRowIndex = selectIndexs.lastSelectRowIndex;  
				 	         selectIndexs.lastSelectRowIndex = tempIndex;  
				 	     }  
				 	     for(var i = selectIndexs.firstSelectRowIndex ; i <= selectIndexs.lastSelectRowIndex ; i++){ 
				 	         $('.oasis_datagrid_table').datagrid('checkRow', i);     
				 	     }
				 	    // 2016年9月14日 13:47:12 update  修改 连选 取消下拉框
				 	      //$('.bookdao-combobox').combobox().next('span').find('input').focus();
				 	      $('.form-control.input-xs')[0].focus();
				 	      $('.form-control').find('input').focus();
				 	      $('.form-control.input-xs')[0].blur();
				 	      //$('.bookdao-combobox').combobox().next('span').find('input').blur();
				 	      $('.form-control').blur();
				 	     
				 	    
				 	   
				 	     
				 	     
				 	 } 
				 	
			}
			 });
		 

})
